﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TRPOP.Common
{
    /// <summary>
    /// 信息审核状态枚举
    /// </summary>
    public enum AuditStatus
    {
        /// <summary>
        /// 审核未通过
        /// </summary>
        UnAudited = 4,

        /// <summary>
        /// 未处理 信息状态: 信息未审核
        /// </summary>
        UnAudit = 5,

        /// <summary>
        /// 审核通过 信息状态: 未发布，但是信息正常
        /// </summary>
        Audited = 6,

        /// <summary>
        /// 审核通过并发布  信息状态: 信息已发布
        /// </summary>
        AuditedAndPublish = 7
    }

    /// <summary>
    /// 信息审核操作管理
    /// </summary>
    public class AuditStatusManage
    {
        #region 审核流程的几种方式: 一般的信息审核流程 不包含发布的信息审核流程 不包含发布的信息审核流程
        /// <summary>
        /// 一般的信息审核流程
        /// </summary>
        /// <returns></returns>
        public static List<StatusInfo> GetAll()
        {
            List<StatusInfo> olstInfo = new List<StatusInfo>();
            StatusInfo oInfo = null;

            oInfo = new StatusInfo();
            oInfo.DisplayText = "不通过";
            oInfo.Value = (int)AuditStatus.UnAudited;
            olstInfo.Add(oInfo);

            oInfo = new StatusInfo();
            oInfo.DisplayText = "暂不处理";
            oInfo.Value = (int)AuditStatus.UnAudit;
            olstInfo.Add(oInfo);

            oInfo = new StatusInfo();
            oInfo.DisplayText = "通过但暂不发布";
            oInfo.Value = (int)AuditStatus.Audited;
            olstInfo.Add(oInfo);

            oInfo = new StatusInfo();
            oInfo.DisplayText = "通过并不发布";
            oInfo.Value = (int)AuditStatus.AuditedAndPublish;
            olstInfo.Add(oInfo);
            return olstInfo;
        }

        /// <summary>
        ///  审核即发布 的信息流程
        /// </summary>
        /// <returns></returns>
        public static List<StatusInfo> AuditAndPublish()
        {
            List<StatusInfo> olstInfo = new List<StatusInfo>();
            StatusInfo oInfo = null;

            oInfo = new StatusInfo();
            oInfo.DisplayText = "不通过";
            oInfo.Value = (int)AuditStatus.UnAudited;
            olstInfo.Add(oInfo);

            oInfo = new StatusInfo();
            oInfo.DisplayText = "暂不处理";
            oInfo.Value = (int)AuditStatus.UnAudit;
            olstInfo.Add(oInfo);

            oInfo = new StatusInfo();
            oInfo.DisplayText = "通过";
            oInfo.Value = (int)AuditStatus.Audited;

            olstInfo.Add(oInfo);
            return olstInfo;
        }

        /// <summary>
        /// 不包含发布的信息审核流程
        /// </summary>
        /// <returns></returns>
        public static List<StatusInfo> AuditLimit()
        {
            List<StatusInfo> olstInfo = new List<StatusInfo>();
            StatusInfo oInfo = null;

            oInfo = new StatusInfo();
            oInfo.DisplayText = "不通过";
            oInfo.Value = (int)AuditStatus.UnAudited;
            olstInfo.Add(oInfo);

            oInfo = new StatusInfo();
            oInfo.DisplayText = "暂不处理";
            oInfo.Value = (int)AuditStatus.UnAudit;
            olstInfo.Add(oInfo);


            oInfo = new StatusInfo();
            oInfo.DisplayText = "通过并不发布";
            oInfo.Value = (int)AuditStatus.AuditedAndPublish;
            olstInfo.Add(oInfo);
            return olstInfo;
        }

        #endregion
    }


    /// <summary>
    ///  status实体类，为绑定下拉框提供方便
    /// </summary>
    public class StatusInfo
    {
        private int m_intValue = 0;
        private string m_strDisplayText = "";

        /// <summary>
        /// 值
        /// </summary>
        public int Value
        {
            set { m_intValue = value; }
            get { return m_intValue; }
        }

        /// <summary>
        /// 显示文本
        /// </summary>
        public string DisplayText
        {
            set { m_strDisplayText = value; }
            get { return m_strDisplayText; }
        }
    }
}
